home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks
- # Battery item cog
- #
- # Each battery supplies 1000 power units
- #
- # Battery is in inventory bin 17
- # Power is in inventory bin 20
-
- symbols
-
- thing player
-
- message activated
-
- sound batteryActivate=NRG00tBattUse.wav
-
- end
-
- # ========================================================================================
-
- code
-
- activated:
- player = GetSourceRef();
-
- if (GetInv(player, 17) > 0)
- {
- if (GetInv(player, 20) < GetInvMax(player, 20))
- {
- print("using med battery");
-
- if (dwcheckDroidCaps(1048576)!=0) dwplayplayerspeech("", 511);
-
- PlaySoundlocal(batteryActivate, 1.0, 0.0, 0);
- ChangeInv(player, 20, 3000);
- ChangeInv(player, 17, -1);
- if(GetInv(player, 17) == 0) SetInvAvailable(player, 17, 0);
- }
- }
- return;
-
- end
-